home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #11 / Amiga Plus CD - 2002 - No. 11.iso / Tools / MorphOS / Epic4_mos / share / epic / help / 6_functions / trunc < prev    next >
Encoding:
Text File  |  2002-10-28  |  566 b   |  23 lines

  1. Synopsis:
  2.    $trunc(<precision> <float>)
  3.  
  4. Technical:
  5.    This function truncates the given decimal number to the given precision,
  6.    rounding up or down as appropriate.
  7.  
  8. Practical:
  9.    This function is useful for rounding floating-point numbers.  It may be
  10.    used any time, though it is usually most useful when FLOATING_POINT_MATH
  11.    is turned on.
  12.  
  13. Returns:
  14.    truncated number
  15.  
  16. Examples:
  17.    $trunc(2 3.141592654)                 returns "3.14"
  18.    $trunc(5 3.54)                        returns "3.54000"
  19.  
  20. See Also:
  21.    set(4) floating_point_math
  22.  
  23.